Toward an Understanding of Software Code Cloning as a Development Practice

نویسنده

  • Cory Kapser
چکیده

Code cloning is the practice of duplicating existing source code for use elsewhere within a software system. Within the research community, conventional wisdom has asserted that code cloning is generally a bad practice, and that code clones should be removed or refactored where possible. While there is significant anecdotal evidence that code cloning can lead to a variety of maintenance headaches — such as code bloat, duplication of bugs, and inconsistent bug fixing — there has been little empirical study on the frequency, severity, and costs of code cloning with respect to software maintenance. This dissertation seeks to improve our understanding of code cloning as a common development practice through the study of several widely adopted, medium-sized open source software systems. We have explored the motivations behind the use of code cloning as a development practice by addressing several fundamental questions: For what reasons do developers choose to clone code? Are there distinct identifiable patterns of cloning? What are the possible shortand long-term term risks of cloning? What management strategies are appropriate for the maintenance and evolution of clones? When is the “cure” (refactoring) likely to cause more harm than the “disease” (cloning)? There are three major research contributions of this dissertation. First, we propose a set of requirements for an effective clone analysis tool based on our experiences in clone analysis of large software systems. These requirements are demonstrated in an example implementation which we used to perform the case studies prior to and included in this thesis. Second, we present an annotated catalogue of common code cloning patterns that we observed in our studies. Third, we present an empirical study of the relative frequencies and likely harmfulness of instances of these cloning patterns as observed in two mediumsized open source software systems, the Apache web server and the Gnumeric spreadsheet application. In summary, it appears that code cloning is often used as a principled engineering technique for a variety of reasons, and that as many as 71% of the clones in our study could be considered to have a positive impact on the maintainability of the software system. These results suggest that the conventional wisdom that code clones are generally harmful to the quality of a software system has been proven wrong.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Software Cloning in Extreme Programming Environment

Software systems are evolving by adding new functions and modifying existing functions over time. Through the evolution, the structure of software is becoming more complex and so the understandability and maintainability of software systems is deteriorating day by day. These are not only important but one of the most expensive activities in software development. Refactoring has often been appli...

متن کامل

Why and how to control cloning in software artifacts

The majority of the total life cycle costs of long-lived software arises after its first release, during software maintenance. Cloning, the duplication of parts of software artifacts, hinders maintenance: it increases size, and thus effort for activities such as inspections and impact analysis. Changes need to be performed to all clones, instead of to a single location only, thus increasing eff...

متن کامل

Changes to Code Clones in Evolving Software

Although cut-copy-paste (-and-adapt) techniques are considered bad practice, every programmer is using them. Because such practices not only involve duplication but also modification, they are called code cloning and the duplicated code is called code clone. A clone group consists of the code clones that are clones of each other. Code cloning is easy and cheap during software development, but i...

متن کامل

Visualizing and Understanding Code Duplication in Large Software Systems

Code duplication, or code cloning, is a common phenomena in the development of large software systems. Developers have a love-hate relationship with cloning. On one hand, cloning speeds up the development process. On the other hand, clone management is a challenging task as software evolves. Cloning has commonly been considered as undesirable for software maintenance and several research effort...

متن کامل

Nursing Students’ views on Code of Ethics, Commitment to the Ethic of, Academic Dishonesty and Neutralization behaviors

Introduction: Commitment to the ethics of caring in nursing profession is the center of nursing values and it necessitates honesty as its fundamental element. Nursing students’ dishonesty in classroom and clinical situations has the potential to jeopardize nursing practice. Academic misconduct contributes to inaccurate evaluations of nursing students’ knowledge level. Neutralization...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2009